from tarfile import TarFile
from zipfile import ZipFile
from typing import List


class Archive(object):
    _archive = ...  # type: BaseArchive
    def __init__(self, file: file, ext: str='') -> None: ...
    def _archive_cls(self, file: file, ext: str='') -> None: ...
    def extract(self, dst: str='') -> None: ...
    def list(self) -> None: ...
    def filenames(self) -> list: ...
    def close(self) -> None: ...

class BaseArchive(object):
    @staticmethod
    def _copy_permissions(mode: int, filename: str) -> None: ...
    def split_leading_dir(self, path: str) -> None: ...
    def has_leading_dir(self, paths: List[str]) -> None: ...
    def extract(self, dst: str) -> None: ...
    def list(self) -> list: ...
    def filenames(self) -> List[str]: ...

class TarArchive(BaseArchive):
    _archive = ...  # type: TarFile
    def extract(self, dst: str) -> None: ...
    def list(self) -> None: ...
    def filenames(self) -> List[str]: ...
    def close(self) -> None: ...

class ZipArchive(BaseArchive):
    _archive = ...  # type: ZipFile
    def extract(self, dst: str) -> None: ...
    def list(self) -> None: ...
    def filenames(self) -> List[str]: ...
    def close(self) -> None: ...
